package com.android.util;

import android.graphics.Bitmap;

import java.nio.Buffer;

/**
 * Gif 编码器
 */
public class NativeGifEncoder {
    public static native long createEncoder(String path, int width, int height);

    public static native void freeEncoder(long ptr);
    
    public static native void addFrame(long ptr, int width, int height, int delay, Buffer data);

    public static native void addFrameFromBitmap(long ptr, int width, int height, int delay, Bitmap bitmap);

    static {
        System.loadLibrary("gifencode");
    }
}
